<template>
  <!--为echarts准备一个具备大小的容器dom-->
  <div id="main" style="width: 100%;height: 200px;" />
</template>
<script>
import echarts from 'echarts'
export default {
  name: '',
  data() {
    return {
    }
  },
  // 调用
  mounted() {
    this.$nextTick(function() {
      this.drawPie('main')
    })
  },
  methods: {
    drawPie(id) {
      this.charts = echarts.init(document.getElementById(id))
      this.charts.setOption({
        title: {
          text: ''
        },
        tooltip: {
          trigger: 'axis'
        },
        legend: {
          data: ['Step End']
        },
        grid: {
          left: '3%',
          right: '4%',
          bottom: '3%',
          containLabel: true
        },
        // toolbox: {
        //   feature: {
        //     saveAsImage: {}
        //   }
        // },
        xAxis: {
          type: 'category',
          data: ['10：30', '10:40', '10:50', '11:00', '11:10', '11:20', '11:30']
        },
        yAxis: {
          type: 'value'
        },
        series: [
          {
            name: '4543断路器变量',
            type: 'line',
            step: 'start',
            data: [120, 132, 101, 134, 90, 230, 210]
          }
        ]
      })
    }
  }
}
</script>
<style scoped>
    * {
        margin: 0;
        padding: 0;
        list-style: none;
    }
</style>
